package com.zsrt.java.day20170103.lh.daily.demo10;

import static org.junit.Assert.*;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import org.junit.Test;

public class Exception01 {
	
	@Test
	public void testException01()  {
		int a=0;
		try {
			 a=10/0;
		} catch (Exception e) {
			System.out.println("自己处理异常");
			e.printStackTrace();
		}finally{
			
			System.out.println(a);
		}
	}

	@Test
	public void testException02() {
		
		//编译时异常
		try {
			InputStream in=new FileInputStream("a.txt");
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
		
		@Test
		public void testException03() throws Exception {
			
			//编译时异常
			
			
		
		}
}
